const express = require('express');

const setCORS = require('./middlewares/setCORS');

const app = express();

const loginRouter = require('./routers/loginRouter');
const userRouter = require('./routers/userRouter');

const verify = require('./middlewares/verifyToken');

// app.use(setCORS)

app.use(express.static(__dirname+'/public'))

// 路由器中间件 一定要在所有的中间件最后面去调用。
app.use('/admin',loginRouter);
app.use('/admin',verify,userRouter);


app.listen(8081,()=>{
    console.log("服务器启动成功80端口");
})